# from wechaty import Wechaty, Message
import asyncio, os, time
os.environ['WECHATY_PUPPET_SERVICE_TOKEN'] = 'insecure_f47ea95c-01a0-4043-ac24-64c65c551207'
os.environ['WECHATY_PUPPET'] = 'wechaty-puppet-padlocal'
os.environ['WECHATY_PUPPET_SERVICE_ENDPOINT'] = '127.0.0.1:8089'
#
# bot = Wechaty()
#
# class MyBot(Wechaty):
#     async def on_message(self, msg: Message) -> None:
#         text = msg.text()
#         if text == "ding":
#             res = "dong"
#             await msg.say(res)
#
# asyncio.run(MyBot().start())

from wechaty import (
    Contact,
    FileBox,
    Message,
    Wechaty,
    UrlLink,
    ScanStatus,
)

class MyBot(Wechaty):
    async def on_message(self, msg: Message):
        # print(msg)
        # exit()
        # 返回链接
        urlLink = UrlLink.create(
          description= '企业要么创造增量！要么迈向衰退！',
          thumbnail_url= 'https://www.test.com',
          title= '《大成商道·增量盈利》方案班',
          url= 'http://enterpriser.prowealthgroup.cn/index.php?pwEnterpriser/bullet/detail-id_3724.html'
        )
        await msg.say(urlLink)

asyncio.run(MyBot().start())